//
// CPSBrownianForce.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.CVector;
import org.ryzom.nel.misc.IStream;

public class CPSBrownianForce extends CPSForceIntensityHelper {
  private long swigCPtr;

  public CPSBrownianForce(long cPtr, boolean cMemoryOwn) {
    super(nel3dJNI.CPSBrownianForce_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  public static long getCPtr(CPSBrownianForce obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CPSBrownianForce(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public CPSBrownianForce(float intensity) {
    this(nel3dJNI.new_CPSBrownianForce__SWIG_0(intensity), true);
  }

  public CPSBrownianForce() {
    this(nel3dJNI.new_CPSBrownianForce__SWIG_1(), true);
  }

  public void serial(IStream f) {
    nel3dJNI.CPSBrownianForce_serial(swigCPtr, this, IStream.getCPtr(f), f);
  }

  public boolean isIntegrable() {
    return nel3dJNI.CPSBrownianForce_isIntegrable(swigCPtr, this);
  }

  public void integrate(float date, CPSLocated src, long startIndex, long numObjects, CVector destPos, CVector destSpeed, boolean accumulate, long posStride, long speedStride) {
    nel3dJNI.CPSBrownianForce_integrate__SWIG_0(swigCPtr, this, date, CPSLocated.getCPtr(src), src, startIndex, numObjects, CVector.getCPtr(destPos), destPos, CVector.getCPtr(destSpeed), destSpeed, accumulate, posStride, speedStride);
  }

  public void integrate(float date, CPSLocated src, long startIndex, long numObjects, CVector destPos, CVector destSpeed, boolean accumulate, long posStride) {
    nel3dJNI.CPSBrownianForce_integrate__SWIG_1(swigCPtr, this, date, CPSLocated.getCPtr(src), src, startIndex, numObjects, CVector.getCPtr(destPos), destPos, CVector.getCPtr(destSpeed), destSpeed, accumulate, posStride);
  }

  public void integrate(float date, CPSLocated src, long startIndex, long numObjects, CVector destPos, CVector destSpeed, boolean accumulate) {
    nel3dJNI.CPSBrownianForce_integrate__SWIG_2(swigCPtr, this, date, CPSLocated.getCPtr(src), src, startIndex, numObjects, CVector.getCPtr(destPos), destPos, CVector.getCPtr(destSpeed), destSpeed, accumulate);
  }

  public void integrate(float date, CPSLocated src, long startIndex, long numObjects, CVector destPos, CVector destSpeed) {
    nel3dJNI.CPSBrownianForce_integrate__SWIG_3(swigCPtr, this, date, CPSLocated.getCPtr(src), src, startIndex, numObjects, CVector.getCPtr(destPos), destPos, CVector.getCPtr(destSpeed), destSpeed);
  }

  public void integrate(float date, CPSLocated src, long startIndex, long numObjects, CVector destPos) {
    nel3dJNI.CPSBrownianForce_integrate__SWIG_4(swigCPtr, this, date, CPSLocated.getCPtr(src), src, startIndex, numObjects, CVector.getCPtr(destPos), destPos);
  }

  public void integrate(float date, CPSLocated src, long startIndex, long numObjects) {
    nel3dJNI.CPSBrownianForce_integrate__SWIG_5(swigCPtr, this, date, CPSLocated.getCPtr(src), src, startIndex, numObjects);
  }

  public void integrateSingle(float startDate, float deltaT, long numStep, CPSLocated src, long indexInLocated, CVector destPos, boolean accumulate, long posStride) {
    nel3dJNI.CPSBrownianForce_integrateSingle__SWIG_0(swigCPtr, this, startDate, deltaT, numStep, CPSLocated.getCPtr(src), src, indexInLocated, CVector.getCPtr(destPos), destPos, accumulate, posStride);
  }

  public void integrateSingle(float startDate, float deltaT, long numStep, CPSLocated src, long indexInLocated, CVector destPos, boolean accumulate) {
    nel3dJNI.CPSBrownianForce_integrateSingle__SWIG_1(swigCPtr, this, startDate, deltaT, numStep, CPSLocated.getCPtr(src), src, indexInLocated, CVector.getCPtr(destPos), destPos, accumulate);
  }

  public void integrateSingle(float startDate, float deltaT, long numStep, CPSLocated src, long indexInLocated, CVector destPos) {
    nel3dJNI.CPSBrownianForce_integrateSingle__SWIG_2(swigCPtr, this, startDate, deltaT, numStep, CPSLocated.getCPtr(src), src, indexInLocated, CVector.getCPtr(destPos), destPos);
  }

  public static void initPrecalc() {
    nel3dJNI.CPSBrownianForce_initPrecalc();
  }

  public void setIntensity(float value) {
    nel3dJNI.CPSBrownianForce_setIntensity(swigCPtr, this, value);
  }

  public void setIntensityScheme(SWIGTYPE_p_NL3D__CPSAttribMakerT_float_t scheme) {
    nel3dJNI.CPSBrownianForce_setIntensityScheme(swigCPtr, this, SWIGTYPE_p_NL3D__CPSAttribMakerT_float_t.getCPtr(scheme));
  }

  public void computeForces(CPSLocated target) {
    nel3dJNI.CPSBrownianForce_computeForces(swigCPtr, this, CPSLocated.getCPtr(target), target);
  }

  public void show() {
    nel3dJNI.CPSBrownianForce_show(swigCPtr, this);
  }

  public void setParametricFactor(float factor) {
    nel3dJNI.CPSBrownianForce_setParametricFactor(swigCPtr, this, factor);
  }

  public float getParametricFactor() {
    return nel3dJNI.CPSBrownianForce_getParametricFactor(swigCPtr, this);
  }

}
